home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7208 < prev    next >
Encoding:
Text File  |  1996-08-05  |  754 b   |  32 lines

  1. Path: news.byu.edu!news
  2. From: Nathan Nesbit <Nathan_Nesbit@byu.edu>
  3. Newsgroups: comp.lang.c++
  4. Subject: sizeof dymanic arrays
  5. Date: Wed, 21 Feb 1996 20:44:58 -0700
  6. Organization: Brigham Young University
  7. Message-ID: <312BE6BA.3725@byu.edu>
  8. NNTP-Posting-Host: cnr067.byu.edu
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  13.  
  14. Hello.  I have a problem wit getting the sie of a dynamic array.
  15.  
  16.     
  17.  
  18.     This is in DOS real mode (large memory model)
  19.  
  20.         {
  21.         char* temp;
  22.  
  23.         temp=new char[10];
  24.  
  25.         cout << sizeof temp;
  26.         }
  27.  
  28.     I get 4 back for this.  Which is the size of the pointer, not th=e array.  Does anyone know how to get the number of elements in a 
  29. dynamic array?
  30.  
  31.     Thanks much.
  32.